<?php
/*
 * Created on 2010 aug 20
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */

function ajax_link ($func, $data, $showprogress, $target, $closebox = false)
{
	$data_out = "";
	if (is_array($data))
	{
		$data_out .= '{ ';
		$i = 0;
		foreach ($data as $key => $value)
		{
			$val_out = 'NULL';
			if (is_numeric($value)) $val_out = $value;
			if (is_string($value)) $val_out = "'" . $value . "'";
			if (substr($value, 0, 1) == '$') $val_out = $value;
			if ($i != 0) $data_out .= ', ';
			$data_out .= $key . ': ' . $val_out;
			$i++;
		}
		$data_out .= '}';
	}
	$showprogress_out = 'false';
	if (is_bool($showprogress))
	{
		if ($showprogress === true) $showprogress_out = 'true';
	}
	$closebox_out = 'false';
	if (is_bool($closebox))
	{
		if ($closebox === true) $closebox_out = 'true';
	}
	return "ajax_click('{$func}', {$data_out}, {$showprogress_out}, '{$target}', {$closebox_out});";
}
?>
